package com.hs.server.config;

import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.hs.server.domain.VehQueuexxb;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.concurrent.*;

/**
 * @Description
 * @Author: chenjiarui
 * @Date: 2021-07-21 19:34
 */

@Component
@ConfigurationProperties(prefix = "thirdpart")
@Data
public class MyConfig {
    public ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("myThread-pool-%d").build();
    public ExecutorService executorService = new ThreadPoolExecutor(50, 200,
            0L, TimeUnit.MILLISECONDS,
            new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());
    public boolean openThread;//配置线程是否关闭全局变量
    public LinkedBlockingQueue<VehQueuexxb> workQueue = new LinkedBlockingQueue<>();//线程安全
    public String imgPath;
    public boolean open18C92;//是否开启18C92
    public long timeInterval;//时间间隔
    public int compareThreshold;//算法比对阈值
    public String startTime;//开始时间
}
